<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js/jquery-1.8.3.min.js"></script>
<style>

</style>
</head>
<body>
	<h1>还有<span>8</span>秒开始</h1>
	<button>获取验证码</button>
<script>
$(function(){
var s=8;
$("button").click(function(){
setInterval(function(){
	s--;
	if(s<1){
		s=0;
		$("button").text("重新获取")
	}
	$("span").text(s)
},1000)
})
})
</script>
</body>
</html>